package com.msb.api.advice;

import com.msb.api.util.R;
import com.msb.api.vo.ResultVo;
import com.msb.common.exception.ApiException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: lmf
 * @Create: 2025/3/8 17:19
 * Description:  api异常
 */
@RestControllerAdvice //控制层统一异常处理
public class ApiExceptionHandler {
    @ExceptionHandler(ApiException.class)
    public ResultVo apiException(ApiException e){
        return R.error(e);
    }
}
